package com.manage.func.ordermanagement.loanorder.service.impl;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.manage.base.service.impl.BaseServiceImpl;
import com.manage.func.ordermanagement.loanorder.dao.ILoanOrderDao;
import com.manage.func.ordermanagement.loanorder.model.LoanOrderBean;
import com.manage.func.ordermanagement.loanorder.model.LoanOrderBooksBean;
import com.manage.func.ordermanagement.loanorder.model.LoanOrderExcelBean;
import com.manage.func.ordermanagement.loanorder.model.LoanOrderExportQueryBean;
import com.manage.func.ordermanagement.loanorder.service.ILoanOrderService;

@Service("loanorderServiceManage")
@Transactional
public class LoanOrderServiceImpl
		extends BaseServiceImpl<LoanOrderBean>
		implements ILoanOrderService {

	@Autowired
	ILoanOrderDao dao;

	@Override
	public List<LoanOrderBean> selectLoanOrderList(LoanOrderBean bean) {
		return dao.selectLoanOrderList(bean);
	}

	@Override
	public int updateLoanOrder(LoanOrderBean queryBean) {
		return dao.updateLoanOrder(queryBean);
	}
	
	@Override
	public int updateExpressMessage(LoanOrderBean queryBean) {
		return dao.updateExpressMessage(queryBean);
	}

	@Override
	public int selectTotalCount(LoanOrderBean queryBean) {
		return dao.selectTotalCount(queryBean);
	}
	
	@Override
	public List<LoanOrderBooksBean> selectLoanOrderBooks(LoanOrderBean queryBean) {
		return dao.selectLoanOrderBooks(queryBean);
	}
	
	@Override
	public void loanOrderFailProcess(LoanOrderBean queryBean) {
		//插入购物车信息
		dao.insertCart(queryBean);
		//删除订单信息
		dao.deleteLoanOrder(queryBean);
		//删除订单明细信息
		dao.deleteLoanOrderDetail(queryBean);
	}

	@Override
	public List<LoanOrderExcelBean> selectLoanOrderExcel(LoanOrderExportQueryBean queryBean)
	{
		return dao.selectLoanOrderExcel(queryBean);
	}

}
